Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure create_hls runs only after all encodings finish #1095

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bobcarroll
Copy link

Description

This patch addresses #929 and #962 by ensuring that create_hls only runs Bento after all h264 encodings are finished. #957 may be fixed by this too as higher resolution encodings won't appear in the player selection without HLS.

Calling Bento with more than one media file doesn't work because the files argument is interpreted as a single (quoted) value. It seems like the original intention may have been to generate HLS files as each encoding finishes, and this case wasn't triggered until I eliminated duplicate runs of Bento.

#938 didn't fix the problem for me. create_hls was (indirectly) being called from line 1588 of files/models.py and all of my uploads were failing to encode regardless of size. The encoded files were still created and visible in the web UI, with the exception of higher resolution encodings.

Steps

Upload a video file with Bento installed and properly configured.

@mgogoulos
Copy link
Contributor

I'll need to have another look on this, as a quick fix I've commited 5a1e4f2 and released v4.2.0

Can you sync this branch, since there's a conflict to tasks.py?

Thanks

@bobcarroll
Copy link
Author

@mgogoulos done

@mgogoulos
Copy link
Contributor

this is good work, however i'm thinking what could be the implications, fore example

  1. hls will be prepared once all encodings have finished, which means that it will take longer than it currently does, because now it prepares a 240px resolution that is very fast, and makes the video available. If it has to wait fro all resolutions to finish, it could take much more time
  2. the fact that it runs every time there's a new encoding read (current behavior), means it acts as a fallback if some encoding task fails. If your changes get merged, we're losing this mechanism and if an encoding goes wrong, there's no HLS

I think what is needed here is a special handling of tasks.create_hls in order to do two things:

  1. call Bento with the new files only (not the existing ones), so basically call Bento each time there's a new encoding with this encoding file only
  2. update the master.m3u8 file with any new entries...

what we do now, run Bento with all files, can be optimizing with running with specific files only. I think that's a better solution in the long term

@mgogoulos
Copy link
Contributor

would that solution work for you @bobcarroll ? and if so , do you have capacity to work on it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants